import user from '../../utils/user'
const app = getApp()
const mini = wx.getAccountInfoSync()
const version = mini.miniProgram.version || mini.miniProgram.envVersion
Component({
    data: {
        isUp: false,
        content: app.upContent,
        isShow: app.isShowVtip
    },
    ready() {
        user.waitLogin().then(()=>{
            if(version !== wx.getStorageSync('version')) {
                this.setData({
                    isUp: true
                })
            }
        }, ()=>{// 新用户不显示更新日志
            this.onKnow()
        })

    },
    methods: {
        onKnow() {
            wx.setStorageSync('version', version)
            this.setData({
                isUp: false
            })
        }
    }
})
